import {JSX, mergeProps} from 'solid-js';

interface CodeImageLogoV2Props {
  withGradient?: boolean;
}

export const CodeImageLogoV2 = (
  props: JSX.IntrinsicElements['svg'] & CodeImageLogoV2Props,
) => {
  const mergedProps = mergeProps({withGradient: true}, props);
  const color = '#fff';

  const style = () => {
    let computedStyle = `.cls-1 { fill: ${color} }`;
    if (mergedProps.withGradient) {
      computedStyle += ` .cls-2 { fill: url(#codeimage-gradient-blue); }`;
    } else {
      computedStyle += ` .cls-2 { fill: unset }`;
    }
    return computedStyle;
  };

  return (
    <svg
      id="codeimage-logo-blue-dark-v1"
      data-name="codeimage-logo-blue-dark-v1"
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 943.8 183.56"
      {...props}
    >
      <defs>
        <style>
          {`.cls-1 { fill: ${color} } .cls-2 { fill: url(#codeimage-gradient-blue); }`}
          {`[data-theme-mode=light] .cls-1 { fill: #000 } [data-theme-mode=light] .cls-3 { fill: #fff }`}
          {`[data-cui-theme=light] .cls-1 { fill: #000 } [data-cui-theme=light] .cls-3 { fill: #fff }`}
        </style>
        <linearGradient
          id="codeimage-gradient-blue"
          data-name="codeimage-gradient-blue"
          x1="134.93"
          y1="184.31"
          x2="48.64"
          y2="-.75"
          gradientUnits="userSpaceOnUse"
        >
          <stop offset="0" stop-color="#06c" />
          <stop offset="1" stop-color="#07f" />
        </linearGradient>
      </defs>
      <g id="logo-blue-dark-v1-box" data-name="logo-blue-dark-v1-box">
        <g id="logo-blue-dark-v1">
          <rect
            id="logo-container"
            class={`cls-2`}
            style={{fill: mergedProps.withGradient ? undefined : 'unset'}}
            width="183.56"
            height="183.56"
            rx="60.48"
            ry="60.48"
          />
          <g id="c-shape-6">
            <path
              class="cls-1"
              d="M255.94,133.71c-7.04-3.75-12.52-9.22-16.45-16.38-3.93-7.17-5.89-15.79-5.89-25.86s1.96-18.67,5.89-25.79c3.92-7.12,9.41-12.56,16.45-16.32,7.04-3.75,15.21-5.63,24.51-5.63,8.02,0,15.15,1.39,21.38,4.16,6.23,2.77,11.26,6.66,15.1,11.65,3.84,4.99,6.19,10.82,7.04,17.47h-20.22c-1.11-4.78-3.73-8.68-7.87-11.71-4.14-3.03-9.28-4.54-15.42-4.54-8.02,0-14.4,2.56-19.14,7.68-4.74,5.12-7.1,12.8-7.1,23.04s2.37,18.05,7.1,23.17c4.74,5.12,11.11,7.68,19.14,7.68,5.97,0,11.09-1.49,15.36-4.48,4.27-2.99,6.91-6.95,7.94-11.9h20.22c-.77,6.66-3.12,12.5-7.04,17.54-3.93,5.04-9.02,8.94-15.3,11.71-6.27,2.77-13.33,4.16-21.18,4.16-9.3,0-17.47-1.88-24.51-5.63Z"
            />
            <path
              class="cls-1"
              d="M348.04,135.12c-5.21-2.82-9.24-6.87-12.1-12.16-2.86-5.29-4.29-11.65-4.29-19.07s1.36-13.29,4.1-18.62c2.73-5.33,6.66-9.49,11.78-12.48,5.12-2.99,11.31-4.48,18.56-4.48,6.83,0,12.82,1.41,17.98,4.22,5.16,2.82,9.17,6.89,12.03,12.22,2.86,5.33,4.29,11.71,4.29,19.14s-1.37,13.29-4.1,18.62c-2.73,5.33-6.64,9.47-11.71,12.42-5.08,2.94-11.24,4.42-18.5,4.42-6.83,0-12.84-1.41-18.05-4.22Zm29.06-16c2.82-3.33,4.22-8.4,4.22-15.23s-1.37-11.9-4.1-15.23c-2.73-3.33-6.44-4.99-11.14-4.99s-8.45,1.66-11.26,4.99c-2.82,3.33-4.22,8.41-4.22,15.23s1.39,11.8,4.16,15.17c2.77,3.37,6.51,5.06,11.2,5.06s8.32-1.66,11.14-4.99Z"
            />
            <path
              class="cls-1"
              d="M415.88,130.45c-5.04-5.93-7.55-14.78-7.55-26.56s2.52-20.76,7.55-26.69c5.03-5.93,11.65-8.9,19.84-8.9,5.29,0,9.83,1.2,13.63,3.58,3.8,2.39,6.51,5.59,8.13,9.6h1.02V44.88h18.82v93.31h-18.18l-.64-12.03h-1.02c-1.62,3.93-4.33,7.1-8.13,9.54-3.8,2.43-8.34,3.65-13.63,3.65-8.19,0-14.81-2.96-19.84-8.9Zm35.65-8.77c2.26-1.62,3.95-3.73,5.06-6.34,1.11-2.6,1.66-5.35,1.66-8.26v-6.53c0-2.99-.56-5.76-1.66-8.32-1.11-2.56-2.8-4.65-5.06-6.27-2.26-1.62-5.14-2.43-8.64-2.43-4.61,0-8.32,1.64-11.14,4.93-2.82,3.29-4.22,8.43-4.22,15.42s1.41,12.01,4.22,15.3c2.82,3.29,6.53,4.93,11.14,4.93,3.5,0,6.38-.81,8.64-2.43Z"
            />
            <path
              class="cls-1"
              d="M503.88,134.99c-5.08-2.9-8.98-6.98-11.71-12.22-2.73-5.25-4.1-11.37-4.1-18.37,0-7.42,1.39-13.82,4.16-19.2,2.77-5.38,6.68-9.54,11.71-12.48,5.03-2.94,10.92-4.42,17.66-4.42,7.94,0,14.46,1.73,19.58,5.18s8.79,8.19,11.01,14.21c2.22,6.02,2.94,12.82,2.18,20.42h-47.74c-.09,5.46,1.32,9.66,4.22,12.61,2.9,2.94,6.7,4.42,11.39,4.42,3.58,0,6.63-.79,9.15-2.37,2.52-1.58,4.12-3.69,4.8-6.34h17.79c-.6,4.61-2.33,8.62-5.18,12.03-2.86,3.41-6.55,6.08-11.07,8-4.52,1.92-9.69,2.88-15.49,2.88-7.17,0-13.29-1.45-18.37-4.35Zm7.36-48.83c-2.65,2.43-4.14,5.74-4.48,9.92h29.18c-.26-4.61-1.73-8.02-4.42-10.24-2.69-2.22-6-3.33-9.92-3.33-4.27,0-7.72,1.22-10.37,3.65Z"
            />
            <path class="cls-1" d="M567.43,44.88h19.97v93.31h-19.97V44.88Z" />
            <path
              class="cls-1"
              d="M604.16,69.58h18.18l.64,12.42h.77c1.71-4.52,4.48-7.94,8.32-10.24,3.84-2.3,8.06-3.46,12.67-3.46s9.13,1.15,13.06,3.46c3.92,2.3,6.83,6.27,8.7,11.9h1.02c1.62-5.12,4.5-8.96,8.64-11.52,4.14-2.56,8.81-3.84,14.02-3.84,4.44,0,8.4,.94,11.9,2.82,3.5,1.88,6.29,4.89,8.38,9.02,2.09,4.14,3.14,9.66,3.14,16.58v41.47h-18.82v-37.38c0-5.8-.96-10.11-2.88-12.93-1.92-2.82-5.01-4.22-9.28-4.22-4.52,0-8.04,1.64-10.56,4.93-2.52,3.29-3.78,7.1-3.78,11.46v38.14h-18.82v-37.38c0-5.8-.96-10.11-2.88-12.93-1.92-2.82-5.01-4.22-9.28-4.22-4.61,0-8.15,1.64-10.62,4.93-2.48,3.29-3.71,7.1-3.71,11.46v38.14h-18.82V69.58Z"
            />
            <path
              class="cls-1"
              d="M729.02,133.97c-4.14-3.58-6.21-8.28-6.21-14.08,0-5.2,1.22-9.41,3.65-12.61,2.43-3.2,5.76-5.55,9.98-7.04,4.22-1.49,8.94-2.24,14.14-2.24h16v-4.74c0-3.16-.94-5.67-2.82-7.55-1.88-1.88-4.82-2.82-8.83-2.82s-7.04,.85-9.09,2.56c-2.05,1.71-3.07,3.93-3.07,6.66h-17.54c0-7.25,2.73-13.03,8.19-17.34,5.46-4.31,13.06-6.46,22.78-6.46,9.13,0,16.28,2.07,21.44,6.21,5.16,4.14,7.74,10.65,7.74,19.52v30.21c0,1.62,.04,3.39,.13,5.31,.08,1.92,.21,3.67,.38,5.25,.17,1.58,.38,2.71,.64,3.39h-17.79c-.68-2.05-1.11-5.63-1.28-10.75h-.77c-1.11,3.58-3.63,6.46-7.55,8.64-3.93,2.18-8.53,3.26-13.82,3.26-6.74,0-12.18-1.79-16.32-5.38Zm33.86-11.71c2.47-2.09,3.71-4.97,3.71-8.64v-4.86h-12.42c-8.28,0-12.42,2.77-12.42,8.32,0,2.65,.96,4.69,2.88,6.14,1.92,1.45,4.63,2.18,8.13,2.18,4.27,0,7.64-1.04,10.11-3.14Z"
            />
            <path
              class="cls-1"
              d="M806.34,155.15c-5.25-3.8-8.13-8.85-8.64-15.17h18.05c.43,2.3,1.75,4.14,3.97,5.5,2.22,1.36,5.03,2.05,8.45,2.05,5.55,0,9.51-1.17,11.9-3.52,2.39-2.35,3.58-5.87,3.58-10.56v-11.78h-1.02c-1.54,3.67-4.14,6.66-7.81,8.96-3.67,2.3-7.98,3.46-12.93,3.46-8.19,0-14.74-2.77-19.65-8.32-4.91-5.55-7.36-13.74-7.36-24.58s2.5-19.03,7.49-24.58c4.99-5.55,11.54-8.32,19.65-8.32,4.95,0,9.24,1.11,12.86,3.33,3.63,2.22,6.21,5.21,7.74,8.96h1.02l.51-11.01h18.3v60.42c0,7.6-1.45,13.65-4.35,18.18-2.9,4.52-6.96,7.76-12.16,9.73-5.21,1.96-11.26,2.94-18.18,2.94-9.05,0-16.19-1.9-21.44-5.7Zm33.34-40c2.47-2.99,3.8-6.31,3.97-9.98l-.13-8.19c-.09-2.39-.68-4.67-1.79-6.85-1.11-2.18-2.73-3.95-4.86-5.31-2.13-1.36-4.78-2.05-7.94-2.05-4.52,0-8.13,1.52-10.82,4.54-2.69,3.03-4.03,7.66-4.03,13.89s1.34,10.86,4.03,13.89c2.69,3.03,6.25,4.54,10.69,4.54,4.78,0,8.4-1.49,10.88-4.48Z"
            />
            <path
              class="cls-1"
              d="M887.36,134.99c-5.08-2.9-8.98-6.98-11.71-12.22-2.73-5.25-4.1-11.37-4.1-18.37,0-7.42,1.39-13.82,4.16-19.2,2.77-5.38,6.68-9.54,11.71-12.48,5.03-2.94,10.92-4.42,17.66-4.42,7.94,0,14.46,1.73,19.58,5.18s8.79,8.19,11.01,14.21c2.22,6.02,2.94,12.82,2.18,20.42h-47.74c-.09,5.46,1.32,9.66,4.22,12.61,2.9,2.94,6.7,4.42,11.39,4.42,3.58,0,6.63-.79,9.15-2.37,2.52-1.58,4.12-3.69,4.8-6.34h17.79c-.6,4.61-2.33,8.62-5.18,12.03-2.86,3.41-6.55,6.08-11.07,8-4.52,1.92-9.69,2.88-15.49,2.88-7.17,0-13.29-1.45-18.37-4.35Zm7.36-48.83c-2.65,2.43-4.14,5.74-4.48,9.92h29.18c-.26-4.61-1.73-8.02-4.42-10.24-2.69-2.22-6-3.33-9.92-3.33-4.27,0-7.72,1.22-10.37,3.65Z"
            />
          </g>
          <rect
            id="c-shape-5"
            class="cls-1 cls-3"
            x="83.95"
            y="134.35"
            width="53.15"
            height="14.08"
            rx="6.65"
            ry="6.65"
            transform="translate(-42.28 47.27) rotate(-20.35)"
          />
          <rect
            id="c-shape-4"
            class="cls-1 cls-3"
            x="57.33"
            y="109.86"
            width="88.58"
            height="14.08"
            rx="6.65"
            ry="6.65"
            transform="translate(-34.31 42.64) rotate(-20.35)"
          />
          <rect
            id="c-shape-3"
            class="cls-1 cls-3"
            x="34.58"
            y="94.74"
            width="73.6"
            height="14.08"
            rx="6.65"
            ry="6.65"
            transform="translate(-30.94 31.18) rotate(-20.35)"
          />
          <rect
            id="c-shape-2"
            class="cls-1 cls-3"
            x="48.81"
            y="40.65"
            width="53.15"
            height="14.08"
            rx="6.65"
            ry="6.65"
            transform="translate(-11.88 29.19) rotate(-20.35)"
          />
          <rect
            id="c-shape-1"
            class="cls-1 cls-3"
            x="40.15"
            y="63.55"
            width="88.58"
            height="14.08"
            rx="6.65"
            ry="6.65"
            transform="translate(-19.28 33.77) rotate(-20.35)"
          />
        </g>
      </g>
    </svg>
  );
};
